﻿@model XT.Exam.MODEL.QuestionShow
@using XT.Exam.MODEL
@{
    ViewBag.Title = "ToLeadQuestion";
}
<title>导入试题信息</title>
<h3>上传试题信息</h3>
<link href="~/Content/static/h-ui/css/H-ui.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="~/Content/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="~/Content/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="~/Content/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="~/Content/static/h-ui.admin/css/style.css" />

@using (Html.BeginForm("ToLeadList", "SysUserInfo", FormMethod.Post, new { enctype = "multipart/form-data", id = "form_Upload" }))
{
    <div>
        <label>学院：</label>
        <select id="College" name="CollegeID" onchange="changeTie() "></select>
        <label>系：</label>
        <select id="Tie" name="TieID" onchange="changephasetable() "></select>
        <label>阶段：</label>
        <select id="phasetable" name="PhaseID"></select>
        <label>单元：</label>
       @Html.DropDownList("ID")
    </div>
    <div class="input-group" style="width:920px;float:left">
        @*文件路径的文本框*@
        <label style="float:left;">请选择Excel文件：<input id="txt_Path" type="text" class="input-text upload-url radius" style="width:700px" onclick="$('input[id=fileUpload]').click();"></label>
        <input id="fileUpload" type="file" name="file" style="display:none;" />
        @*浏览本地文件按钮*@
        <span id="btn_Browse" style="cursor:pointer;" onclick="$('input[id=fileUpload]').click();" class="btn btn-primary radius">
            <i class="Hui-iconfont-pages"></i>浏览文件
        </span>
    </div>
   
}

<button type="button" id="go" class="btn primary radius" onclick="AddAll()">开始上传</button>


<div style="margin-top:15px;">
    <div style="overflow-y:auto;overflow-x:hidden;">
        <table class=" table table-border radius" style="width:100%">
        <thead>
            <tr class="text-c">
                <td>@Html.DisplayNameFor(n=>n.ExamType_Name)</td>
                <td>@Html.DisplayNameFor(n => n.Questionbank_Name)</td>
                <td>@Html.DisplayNameFor(n => n.Options_Count)</td>
                <td>@Html.DisplayNameFor(n => n.Rightkey)</td>
            </tr>
        </thead>

        <tbody class="text-c">

            @if (ViewBag.list != null)
            {
                foreach (var item in (ViewBag.list as IEnumerable<XT.Exam.MODEL.QuestionShow>))
                {
                    <tr class="text-c">
                        <td>@item.ExamType_Name</td>
                        <td>@item.Questionbank_Name</td>
                        <td>@item.Options_Count</td>
                        <td>@item.Rightkey</td>
                    </tr>
                }
            }
        </tbody>

        </table>
    </div>
</div>
<script type="text/javascript" src="~/Content/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="~/Content/lib/layer/2.4/layer.js"></script>
<script src="~/Content/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="~/Content/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->

@section scripts{

    <style type="text/css">
        #btn_Browse:hover {
            color: #3C763D;
        }
    </style>
    <script type="text/javascript">
        $('input[id=fileUpload]').change(function () {
            $('#txt_Path').val($(this).val());
            $('#form_Upload').submit();
        });
    </script>
<script src="~/JS/TestPaperJS.js"></script>
    <script type="text/javascript">
        function AddAll() {
            var College=  $("#College").val();
            var  Tie=$("#Tie").val();
            var phasetable = $("#phasetable").val();
            var Unit = $("#ID").val();
            $.ajax({
                url: '/SysUserInfo/QuestionAll?list=@(Session["Questionlist"] = ViewBag.list))&College=' + College + '&Tie=' + Tie + "&phasetable=" + phasetable + "&Unit=" + Unit,
                type: "Get",
                success: function (obj) {
                    if (obj > 0) {
                        alert('导入成功');
                        location.href = '/SysUserInfo/StudentShow';
                    }
                    else {
                        alert('导入失败');
                        location.href = this.url;
                    }
                }
            })
        }
    </script>



}

